﻿using System;
using System.Collections.Generic;
using System.IO;
using System.ComponentModel;

namespace NthDownload.Contracts.Plugins.Downloads
{
    public interface IDownload : INotifyPropertyChanged
    {
        string GUID { get; }
        
        string ParentGUID { get; }

        bool CanResume { get; }
        bool CanQueue { get; }
        bool HasSize { get; }
        bool IsInitialized { get; }

        string Path { get; }

        string DestinationFolder { get; set; }
        string DestinationPath { get; set; }

        string Description { get; }

        long Size { get; }
        string FileName { get; set; }

        int Position { get; set; }
        int ChunkSize { get; set; }
        int RetryCount { get; set; }
        long DownloadedAmount { get; set; }
        List<DownloadSegment> Segments { get; set; }

        DateTime DateCreated { get; set; }
        DateTime DateCompleted { get; set; }
        TimeSpan TimeElapsed { get; set; }

        DownloadStatuses Status { get; set; }

        /// <summary>
        /// Implementation of this method must be thread safe.
        /// </summary>
        IDownloadStream OpenStream(long startPosition, long endPosition);
    }
}
